package com.ysstech.system.service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ysstech.common.entity.TreeNode;
import com.ysstech.common.entity.Organization;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 机构服务类
 * </p>
 *
 * @author lishuangliang
 * @since 2020-09-12
 */
public interface OrganizationService extends IService<Organization> {

    /**
     * 查询登录机构树信息
     *
     * @return
     */
    public List<TreeNode> queryOrganizationTree(String ordId) throws Exception;

    /**
     * 读取机构文件
     *
     * @param file
     * @throws Exception
     */
    public void readExcel(MultipartFile file) throws Exception;

    /**
     * 查询所有下级机构的机构集合
     *
     * @param orgId 机构编号
     * @return
     * @throws Exception
     */
    public List<Organization> queryListOrganization(String orgId) throws Exception;

    /**
     * 查询所有下级机构的机构id集合
     *
     * @param orgId
     * @return
     * @throws Exception
     */
    public List<String> queryOrganizationIds(String orgId) throws Exception;

    /**
     * 缓存里获取机构信息
     * key 是机构编码
     *
     * @return
     * @throws Exception
     */
    public Map<String, Organization> getCacheOrganizationMap() throws Exception;
}
